package com.example.child_protection.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 类目枚举
 * @author Biz
 * @date 2018-11-3
 */
public enum CategoryEnums {
    CHILD_BASE_INFO( 1000010000L, "CHILD_BASE_INFO", "儿童基本信息"),

    CHILD_PARENT_INFO( 1000020000L , "CHILD_PARENT_INFO", "儿童父母信息"),

    PHYSICAL_EXAMINATION( 1000030000L , "PHYSICAL_EXAMINATION", "儿童体格检查"),

    CHILD_FOOD_CHECK( 1000040000L , "CHILD_FOOD_CHECK", "儿童饮食调查"),

    CHILD_SIGN( 1000050000L , "CHILD_SIGN", "儿童体征"),

    CHILD_SPT_TEST( 1000060000L , "CHILD_FOOD_CHECK", "儿童SPT测试"),

    CHILD_RESULT( 1000070000L , "CHILD_RESULT", "儿童结果信息")

    ;

    private final Long code;

    private final String value;

    private final String displayName;

    private static Map<String, CategoryEnums> valueMap;

    private CategoryEnums( Long code,String value, String displayName) {
        this.value = value;
        this.displayName = displayName;
        this.code = code;
    }

    public CategoryEnums getEnum(String value) {
        return (CategoryEnums) valueMap.get(value);
    }

    public Map<String, CategoryEnums> getAllValueMap() {
        return valueMap;
    }

    public String getValue() {
        return this.value;
    }

    public Long getCode() {
        return this.code;
    }

    public String getDisplayName() {
        return this.displayName;
    }

    static {

        valueMap = new HashMap<String, CategoryEnums>();

        for (CategoryEnums e : values())
            valueMap.put(e.value, e);
    }
}
